package com.goodving.guli.bt.model;

import com.goodving.guli.bt.profile.scale.HeartRateInfo;
import com.goodving.guli.view.C3657a;

/**
 * Created by john on 2015/11/25.
 */
public final class C3910h {
    public final String f19711a;
    public final int f19712b;
    public final int f19713c;
    public final int f19714d;
    public final int f19715e;
    public final int f19716f;
    public int f19717g;

    public C3910h(String str, int i, int i2) {
        this.f19717g = -1;
        this.f19711a = str;
        this.f19712b = Integer.decode("0x" + str.substring(8, 10)).intValue();
        this.f19713c = Integer.decode("0x" + str.substring(10, 12)).intValue();
        this.f19714d = Integer.decode("0x" + str.substring(12, 14)).intValue();
        this.f19715e = i;
        this.f19716f = i2;
    }

    public C3910h(String str, int i, int i2, int i3) {
        this.f19717g = -1;
        this.f19711a = str;
        this.f19712b = Integer.decode("0x" + str.substring(8, 10)).intValue();
        this.f19713c = Integer.decode("0x" + str.substring(10, 12)).intValue();
        this.f19714d = Integer.decode("0x" + str.substring(12, 14)).intValue();
        this.f19715e = i;
        this.f19716f = i2;
        this.f19717g = i3;
    }

    public boolean m25440a() {
        return this.f19717g != -1;
    }

    public boolean m25441b() {
        return ((this.f19712b & HeartRateInfo.HR_EMPTY_VALUE) == 5 && (this.f19713c & HeartRateInfo.HR_EMPTY_VALUE) == 0) || ((this.f19712b & HeartRateInfo.HR_EMPTY_VALUE) == 0 && (this.f19714d & HeartRateInfo.HR_EMPTY_VALUE) == 208);
    }

    public int m25442c() {
        return this.f19716f & HeartRateInfo.HR_EMPTY_VALUE;
    }

    public int m25443d() {
        return (this.f19716f >> 24) & HeartRateInfo.HR_EMPTY_VALUE;
    }

    public int m25444e() {
        return (this.f19716f >> 16) & HeartRateInfo.HR_EMPTY_VALUE;
    }

    public int m25445f() {
        return (this.f19716f >> 8) & HeartRateInfo.HR_EMPTY_VALUE;
    }

    public int m25446g() {
        return this.f19715e & HeartRateInfo.HR_EMPTY_VALUE;
    }

    public int m25447h() {
        return (this.f19715e >> 24) & HeartRateInfo.HR_EMPTY_VALUE;
    }

    public int m25448i() {
        return (this.f19715e >> 16) & HeartRateInfo.HR_EMPTY_VALUE;
    }

    public int m25449j() {
        return (this.f19715e >> 8) & HeartRateInfo.HR_EMPTY_VALUE;
    }

    public String m25450k() {
        return m25443d() + "." + m25444e() + "." + m25445f() + "." + m25442c();
    }

    public int m25451l() {
        return this.f19717g & HeartRateInfo.HR_EMPTY_VALUE;
    }

    public int m25452m() {
        return (this.f19717g >> 24) & HeartRateInfo.HR_EMPTY_VALUE;
    }

    public int m25453n() {
        return (this.f19717g >> 16) & HeartRateInfo.HR_EMPTY_VALUE;
    }

    public int m25454o() {
        return (this.f19717g >> 8) & HeartRateInfo.HR_EMPTY_VALUE;
    }

    public String m25455p() {
        return m25452m() + "." + m25453n() + "." + m25454o() + "." + m25451l();
    }

    public String toString() {
        StringBuilder stringBuilder = new StringBuilder(256);
        String str = C3657a.f18328f + m25447h() + "." + m25448i() + "." + m25449j() + "." + m25446g();
        stringBuilder.append("[[[ " + getClass().getSimpleName() + " ]]]");
        stringBuilder.append("\n         deviceID: " + this.f19711a);
        stringBuilder.append("\n          feature: " + Integer.toHexString(this.f19712b));
        stringBuilder.append("\n       appearance: " + Integer.toHexString(this.f19713c));
        stringBuilder.append("\n  hardwareVersion: " + Integer.toHexString(this.f19714d));
        stringBuilder.append("\n   profileVersion: " + str);
        stringBuilder.append("\n  firmwareVersion: " + m25450k());
        stringBuilder.append("\n  firmware2Version: " + m25455p());
        return stringBuilder.toString();
    }
}
